package com.xian.javabean;

public class Test {
    public static void main(String[] args) {
        //1.创建对象封装数据：无参数构造器
        User user = new User();
        user.setName("小贤");
        user.setAge(18);
        user.setSex('男');
        System.out.println(user.getName());
        System.out.println(user.getAge());
        System.out.println(user.getSex());

        //2.创建对象封装数据：有参数构造器
        User user2 = new User("小贤",18,'女');
        System.out.println(user2.getName());
        System.out.println(user2.getAge());
        System.out.println(user2.getSex());


    }
}
